<template>
	<view>
		<view class="schedule">
			<view class="list" v-if="list.length">
				<view
					:style="{ backgroundImage: `url(${assetsPath}${item.status == 3 ? 'e2cf0f20cb0731b72d1f6f8653579c6c7f2186e3' : 'fb1facf62d9a712f0f2d223b7156f4fac11443af'}.png)` }"
					class="item pr " v-for="(item,index) in list" :key="index">
					<view style="display: flex; justify-content: space-around;  flex-direction: row;">
						<!-- <view style="width: 30%;display: flex;flex-direction: column; align-items: center;height: 160rpx;align-items: stretch;background-color: blanchedalmond; ">
							<view class="">
								2024/05/10 
							</view>
							<view class="">
								课消:1.0  
							</view>
						</view> -->
						<view  style="width: 30%;display: flex;flex-direction: column; justify-content: space-between;height: 160rpx;">
							<view class="" style="font-size: 24rpx;color: #333333;">
								2024/05/10 
							</view>
							<view class="" style="font-size: 24rpx;color: #333333;">
								课消:1.0  
							</view>
						</view>
						<view  style="width: 40%;display: flex;flex-direction: column; justify-content: center; align-items: center;height: 160rpx;">
							<view class="" style="width: 50rpx;height: 50rpx;background: #9EA2F2;border-radius: 20rpx;color: #FFFFFF;text-align: center;">
								今
							</view>
							<view class="" style="font-weight: bold;font-size: 42rpx;color: #333333;">
								14:00~15:00
							</view>
							<view class="" style="font-size: 28rpx;color: #333333;">
								本周日
							</view>
						</view>
						<!-- class="d-flex justify-space-between flex-column" -->
						<view  style="width: 30%;display: flex;flex-direction: column; justify-content: space-between;height: 160rpx;position: relative;">
							<view class="" style="text-align: right;font-size: 24rpx;color: #EB4751;">
								待上课
							</view>
							<view class="" style="position: absolute;right: 0;bottom: 0;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
								<image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`" style="width: 52rpx;height: 52rpx;" mode=""></image>
							</view>
							<!-- <u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
								width="52rpx" height="52rpx"></u-image> -->
						</view>
					</view>
					
					
					<!-- <view class="flex-between" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view class="section">第 {{ item.times }} 节课</view>
						<view class="status" style="font-size: 24rpx;">
							<view style="color: #999;" v-if="index != 3">已上课</view>
							<view style="color: #EB4751;" v-if="index == 3">待上课</view>
						</view>
					</view>
					<view class="flex-align" @click="onclick(item,train_enum_id,class_mode_id,train_item_id)">
						<view>
							<view class="date">222{{ item.sku }}</view>
						</view>
					</view>
					<view class="flex-align">
						<view class="time">
							<view class="d-flex"  v-if="item.status != 1">
								<view
									style="width: 100rpx; height: 100rpx;position: absolute;right: 20rpx;bottom: -32rpx;z-index: 999;">
									<view class="qrcode" style="margin-left: 50rpx;" @click="onClickewm(student_id,train_enum_id,goods_id,item)">
										<u-image :src="`${assetsPath}fdacef21716adb6bb50e280a9351814e2327e9fd.png`"
											width="52rpx" height="52rpx"></u-image>
									</view>
								</view>
							</view>
						</view>
					</view> -->
				</view>
			</view>
			<u-empty v-else text="暂无数据" icon="http://cdn.uviewui.com/uview/empty/data.png" />
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: Array,
			train_enum_id: {
				//参数名
				type: String, //参数名
			},
			class_mode_id: {
				//参数名
				type: String, //参数名
			},
			train_item_id: {
				//参数名
				type: String, //参数名
			},
			goods_id: {
				//参数名
				type: String, //参数名
			},
			student_id: {
				//参数名
				type: String, //参数名
			},
			class_id: {
				//参数名
				type: String, //参数名
			},
		},
		// props:['infos'],
		data() {
			return {
				assetsPath: this.$https.assetsPath,
			}
		},
		computed: {},
		onLoad() {},
		methods: {
			yuyuelist(goods_id,train_item_id,item) {
				console.log(train_item_id,item,'555')
				uni.navigateTo({
					url: './appointment?train_item_id=' + train_item_id + '&coach_name=' + item.coach_name + '&class_hour_name=' + item.class_hour_name + '&coach_id=' + item.coach_id + '&class_record_id=' + item.id  + '&student_name=' + item.student_name ,
				})
			},
			onclick(item,train_enum_id,class_mode_id,train_item_id) {
				console.log(item,train_enum_id,class_mode_id,'1212')
				// <!-- train_enum_id == 1  短训培训班-->
				// <!-- train_enum_id == 2 长训-->
				// <!-- train_enum_id == 3 小班 约课-->
				// class_mode_id = 2 是约课模式
				// is_appointment      1 未约课 2 已约课
				// status课务状态 1已上课 2请假 3 未上课
				if (train_enum_id == 3 && class_mode_id == 2) {
					uni.navigateTo({
						url: './class_appointment?id=' + item.id+ '&train_item_id=' + train_item_id,//预约中
					})
				} else{
					uni.navigateTo({
						url: './class_today?id=' + item.id, //进行中
					})
					// if (item.status === 3) {
					// 	uni.navigateTo({
					// 		url: './class_appointment',//预约中
					// 	})
					// } else if (item.status === 4) {
					// 	uni.navigateTo({
					// 		url: './class_lass', //已上课
					// 	})
					// } else if (item.status === 2) {
					// 	uni.navigateTo({
					// 		url: './class_taught',//待上课
					// 	})
					// } else if (item.status === 1) {
					// 	uni.navigateTo({
					// 		url: './class_today', //进行中
					// 	})
					// }
				}
				
			},
			onClickewm(student_id,train_enum_id,goods_id,item) {
				// <!-- train_enum_id == 1  短训培训班-->
				// <!-- train_enum_id == 2 长训-->
				// <!-- train_enum_id == 3 小班-->
				if (train_enum_id == 1) {
					uni.navigateTo({
						url: '../course_code?student_id=' + student_id + '&goods_id=' + goods_id + '&id=' + item.id,
					});
				} else{
					uni.navigateTo({
						url: '../course_code?student_id=' + item.student_id + '&goods_id=' + goods_id + '&id=' + item.id,
					});
				}
				
				
			},
		}

	}
</script>

<style lang="scss" scoped>
	.schedule {
		padding: 30rpx;

		.list {
			.item {
				border-radius: 20rpx;
				// background: rgb(227,228,251);
				// height: 100%;
				// /* background: url(/static/lanhu_jifenzhuanqu/ps5nuv51mzloe7ybzpwod18la38bhkjjkk4278f36e6-182b-4d49-a296-e7919f1c5f46.png) 100% no-repeat; */
				background-size: 100% 100%;
				// width: 750rpx;
				padding: 20rpx;
				height: 200rpx;
				width: 690rpx;

				&+.item {
					margin-top: 30rpx;
				}

				.section {
					background-color: rgba(85, 190, 243, 0.1);
					border-radius: 21rpx;
					padding: 9rpx 22rpx;
					color: #333333;
					font-size: 24rpx;
				}

				.today {
					right: 0;
					top: 15rpx;
					background: #FA4C4C;
					border-radius: 26rpx 0px 0px 26rpx;
					width: 144rpx;
					height: 52rpx;
					font-size: 26rpx;
					color: #fff;
				}

				.date {
					color: #999999;
					font-size: 24rpx;
				}

				.time {
					color: #333333;
					font-size: 24rpx;
				}

				.booking {
					right: 20rpx;
					bottom: 20rpx;
				}

				.address {
					color: #999999;
					font-size: 20rpx;
				}
			}
		}
	}
</style>
